// 采购分析页面样式 - 2-procurement.less
// 使用rem单位，基于80px基准 (80px = 1rem)

// 变量定义
@primary-color: #4fc3f7;
@secondary-color: #81d4fa;
@accent-color: #bbdefb;
@background-dark: #0f1c3c;
@background-light: #1a2d5a;
@card-bg: rgba(22, 40, 75, 0.7);
@border-color: #2a4a7c;
@text-color: #e0e0e0;
@success-color: #4caf50;
@error-color: #f44336;

// 采购分析页面容器
.procurement-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.3125rem;
}

/* 顶部筛选和数据概览区域 */
.procurement-top-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.3125rem;
  margin-bottom: 0.5rem;
}

/* 筛选区域样式 */
.procurement-filter-section {
  background: @card-bg;
  border-radius: 0.25rem;
  padding: 0.375rem;
  border: 1px solid @border-color;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.3);
}

.procurement-filter-title {
  color: @primary-color;
  font-size: 0.275rem;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
}

.procurement-filter-title i {
  margin-right: 0.2rem;
}

// 筛选条件网格布局
.procurement-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
}

// 筛选条件组
.procurement-filter-group {
  display: flex;
  flex-direction: column;
}

.procurement-filter-label {
  color: @secondary-color;
  margin-bottom: 0.125rem;
  font-size: 0.2125rem;
}

// 筛选下拉框样式
.procurement-filter-select {
  padding: 0.15rem 0.25rem;
  background: rgba(30, 60, 114, 0.7);
  border: 1px solid #3a5f9a;
  border-radius: 0.15rem;
  color: @text-color;
  font-size: 0.2125rem;
}

// 筛选操作区域
.procurement-filter-actions {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-top: 0.25rem;
}

// 年份筛选区域
.procurement-year-filter {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.procurement-year-label {
  color: @secondary-color;
  font-size: 0.2125rem;
  white-space: nowrap;
}

// 年份选择下拉框
.procurement-year-select {
  padding: 0.15rem 0.25rem;
  background: rgba(30, 60, 114, 0.7);
  border: 1px solid #3a5f9a;
  border-radius: 0.15rem;
  color: @text-color;
  font-size: 0.2125rem;
  min-width: 2.5rem;
}

// 查询按钮样式
.procurement-query-btn {
  background: linear-gradient(90deg, @primary-color, #1976d2);
  color: white;
  border: none;
  padding: 0.2rem 0.5rem;
  border-radius: 0.15rem;
  cursor: pointer;
  font-size: 0.225rem;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  margin-left: auto; /* 这个会让按钮推到最右边 */
}

.procurement-query-btn:hover {
  transform: translateY(-0.05rem);
  box-shadow: 0 0.1rem 0.3rem rgba(79, 195, 247, 0.3);
}

/* 数据概览样式 - 2x2布局 */
.procurement-data-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.25rem;
  height: 100%;
}

// 数据概览卡片
.procurement-overview-card {
  background: @card-bg;
  border-radius: 0.2rem;
  padding: 0.375rem;
  text-align: center;
  border: 1px solid @border-color;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.procurement-overview-card:hover {
  transform: translateY(-0.075rem);
  box-shadow: 0 0.15rem 0.375rem rgba(0, 0, 0, 0.3);
  border-color: @primary-color;
}

.procurement-overview-title {
  color: @secondary-color;
  font-size: 0.2125rem;
  margin-bottom: 0.2rem;
}

// 数据概览数值显示
.procurement-overview-value {
  color: @primary-color;
  font-size: 0.35rem;
  font-weight: 700;
  margin-bottom: 0.075rem;
  text-shadow: 0 0 0.2rem rgba(79, 195, 247, 0.3);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.125rem;
}

.procurement-overview-unit {
  color: @accent-color;
  font-size: 0.225rem;
}

/* 结果描述样式 */
.procurement-result-description {
  background: rgba(22, 40, 75, 0.5);
  border-radius: 0.2rem;
  padding: 0.3rem 0.375rem;
  margin-bottom: 0.375rem;
  border-right: 0.1rem solid @primary-color;
  border-left: 0.1rem solid @primary-color;
  font-size: 0.225rem;
  line-height: 1.4;
  color: #ffffff !important; /* 将普通文字改为白色 */
  text-align: right;
}

// 高亮文本样式
.procurement-highlight {
  color: @primary-color;
  font-weight: 600;
}

/* 表格区域样式 */
.procurement-table-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}

// 表格容器
.procurement-table-container {
  background: @card-bg;
  border-radius: 0.25rem;
  padding: 0.375rem;
  border: 1px solid @border-color;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.3);
}

// 表格头部区域
.procurement-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
  min-height: 0.6rem; /* 设置最小高度确保一致性 */
}

.procurement-table-title {
  color: @primary-color;
  font-size: 0.25rem;
  font-weight: 600;
  line-height: 1; /* 确保单行显示 */
  margin: 0; /* 移除默认边距 */
}

// 表格标签页
.procurement-table-tabs {
  display: flex;
  background: rgba(30, 60, 114, 0.5);
  border-radius: 0.15rem;
  padding: 0.075rem;
}

// 标签页按钮
.procurement-tab-btn {
  padding: 0.125rem 0.25rem;
  background: transparent;
  border: none;
  color: @accent-color;
  border-radius: 0.1rem;
  cursor: pointer;
  font-size: 0.2rem;
  transition: all 0.3s ease;
}

.procurement-tab-btn.active {
  background: #1976d2;
  color: white;
}

// 数据表格基础样式
.procurement-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.2125rem;
}

.procurement-data-table th {
  background: rgba(30, 60, 114, 0.7);
  color: @primary-color;
  padding: 0.25rem 0.3rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid @border-color;
}

.procurement-data-table td {
  padding: 0.25rem 0.3rem;
  border-bottom: 1px solid rgba(42, 74, 124, 0.5);
  color: @text-color;
}

.procurement-data-table tr:hover {
  background: rgba(56, 107, 201, 0.2);
}

/* 图表区域样式 */
.procurement-charts-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
}



// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart1 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart2 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart3 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart4 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart5 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart6 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart7 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart8 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart9 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart10 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart11 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}

// 采购分析图表样式 - 与库存指标页面penel保持一致
.procurement-chart12 {
  height: 3rem !important;
  width: 100% !important;
  background: transparent !important;
  //background-color: #6a11cb;

  // 确保在采购分析页面内应用正确样式
  #procurement & {
    height: 3rem;
    width: 100%;
  }
}




// 采购图表容器样式调整，与panel保持一致
.procurement-chart-container {
  // 保持现有的边框和背景样式
  position: relative;
  height: 3.875rem;
  border: 1px solid rgba(25, 186, 139, 0.17);
  padding: 0 0.1875rem 0.0rem;
  background: url("../images/line(1).png") rgba(255, 255, 255, 0.03);
  //background-color: #4CAF50;

  // 与panel相同的装饰边框
  &::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-left: 2px solid #02a6b5;
    border-top: 2px solid #02a6b5;
    content: "";
  }

  &::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-top: 2px solid #02a6b5;
    border-right: 2px solid #02a6b5;
    content: "";
  }

  .procurement-chart-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;

    &::before {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 10px;
      height: 10px;
      border-bottom: 2px solid #02a6b5;
      border-left: 2px solid #02a6b5;
      content: "";
    }

    &::after {
      position: absolute;
      bottom: 0;
      right: 0;
      width: 10px;
      height: 10px;
      border-bottom: 2px solid #02a6b5;
      border-right: 2px solid #02a6b5;
      content: "";
    }
  }

  // 图表标题样式与panel一致
  .procurement-chart-title {
    height: 0.6rem;
    color: #ffffff;
    line-height: 0.6rem;
    text-align: center;
    font-size: 0.25rem;
    font-weight: 400;
    margin-bottom: 0;
  }

  //// 图表区域样式与panel一致
  //.chart, .procurement-chart1 {
  //  height: 3rem;
  //  width: 100%;
  //  //background: transparent;
  //}
}


// 图表占位区域
.procurement-chart-placeholder {
  flex: 1;
  //background: linear-gradient(45deg, #1a3a6b, #2a4a7c);
  background: #6a11cb;
  border-radius: 0.15rem;
  display: flex;
  justify-content: center;
  align-items: center;
  color: @accent-color;
  font-size: 0.225rem;
  text-align: center;
  padding: 0.25rem;

  // 添加以下样式：
  height: 3rem; // 与库存指标页面的 .chart 高度一致
  background: url("../images/line(1).png") rgba(255, 255, 255, 0.03); // 添加背景图片
}

/* 响应式设计 */
@media (max-width: 9.6rem) {
  .procurement-top-section {
    grid-template-columns: 1fr;
  }

  .procurement-table-section {
    grid-template-columns: 1fr;
  }

  .procurement-charts-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .procurement-filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 6.4rem) {
  .procurement-charts-section {
    grid-template-columns: 1fr;
  }

  .procurement-filter-grid {
    grid-template-columns: 1fr;
  }

  .procurement-data-overview {
    grid-template-columns: 1fr;
  }
}

/* 表格切换样式 */
.procurement-bid-table,
.procurement-non-bid-table {
  display: none;

  &.active {
    display: table;
  }
}

/* 右边表格列宽控制 */
#procurement-detail-table {
  table-layout: fixed;
  width: 100%;

  th:nth-child(1), td:nth-child(1) { width: 20%; } /* 二级单位 */
  th:nth-child(2), td:nth-child(2) { width: 20%; } /* 框架协议项目数 */
  th:nth-child(3), td:nth-child(3) { width: 20%; } /* 框架协议金额 */
  th:nth-child(4), td:nth-child(4) { width: 20%; } /* 华能商城项目数 */
  th:nth-child(5), td:nth-child(5) { width: 20%; } /* 华能商城金额 */
}

/* 所有表格数据居中展示 */
.procurement-data-table {
  th, td {
    text-align: center !important;
    vertical-align: middle !important;
  }

  /* 表头居中 */
  th {
    text-align: center !important;
    vertical-align: middle !important;
    word-break: break-word;
    line-height: 1.2;
    padding: 0.15rem 0.1rem;
    font-size: 0.2rem;
  }

  /* 表格数据居中 */
  td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0.15rem 0.1rem;
    font-size: 0.2rem;
  }
}

/* 特别为三个表格设置 */
.procurement-bid-table,
.procurement-non-bid-table,
#procurement-detail-table {
  th, td {
    text-align: center !important;
    vertical-align: middle !important;
  }
}